/*  babbly - lightweight instant messaging and VoIP client written in Java. 
 * 
 *  Copyright (C) 2008  Georgi Dimitrov  mrj[at]abv[dot]bg
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, at version 3 only.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *   
 */
package org.babbly.ui.gui.view;

import java.awt.Cursor;

/**
 *
 * @author  mrj
 */
public class LoginPanel extends javax.swing.JPanel {

    /** Creates new form LoginPanel */
    public LoginPanel() {
        initComponents();
//        CenteredBackgroundBorder cb = null;
//        try {
//        cb = new CenteredBackgroundBorder(ImageIO.read(new File("C:\\after6.jpg")));
//        } catch (IOException ex) {
//        Logger.getLogger(LoginPanel.class.getName()).log(Level.SEVERE, null, ex);
//        }
//        this.setBorder(cb);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        loginDetailsPane = new JBallonPanel(new java.awt.Color(153,153,153));
        usernameLabel = new javax.swing.JLabel();
        usernameField = new javax.swing.JTextField();
        passwordLabel = new javax.swing.JLabel();
        passwordField = new javax.swing.JPasswordField();
        registerLabel = new javax.swing.JLabel();
        passForgotLabel = new javax.swing.JLabel();
        orLabel = new javax.swing.JLabel();
        rememberPassCheckBox = new javax.swing.JCheckBox();
        jLabel1 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        loginBtnPane = new javax.swing.JPanel();
        loginButton = new javax.swing.JButton();
        messagePane = new JBallonPanel(new java.awt.Color(204, 255, 204));
        messageLabel = new javax.swing.JLabel();

        setMinimumSize(new java.awt.Dimension(200, 300));

        loginDetailsPane.setBackground(new java.awt.Color(153, 153, 153));
        loginDetailsPane.setOpaque(false);

        usernameLabel.setText("SIP id");

        passwordLabel.setText("Password");

        passwordField.setEchoChar('\u2022');

        registerLabel.setForeground(new java.awt.Color(51, 51, 255));
        registerLabel.setText("You don't have an account?");
        registerLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));

        passForgotLabel.setForeground(new java.awt.Color(51, 51, 255));
        passForgotLabel.setText("You forgot your password?");
        passForgotLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));

        orLabel.setText("or");

        rememberPassCheckBox.setText("Remember my password");
        rememberPassCheckBox.setFocusPainted(false);
        rememberPassCheckBox.setMargin(new java.awt.Insets(0, 0, 2, 2));
        rememberPassCheckBox.setOpaque(false);

        jLabel1.setFont(new java.awt.Font("Tahoma", 2, 11));
        jLabel1.setText("Example: john@biloxi.com");

        jButton1.setText("Advanced Preferences");
        jButton1.setFocusPainted(false);

        javax.swing.GroupLayout loginDetailsPaneLayout = new javax.swing.GroupLayout(loginDetailsPane);
        loginDetailsPane.setLayout(loginDetailsPaneLayout);
        loginDetailsPaneLayout.setHorizontalGroup(
            loginDetailsPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(loginDetailsPaneLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(loginDetailsPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, loginDetailsPaneLayout.createSequentialGroup()
                        .addGroup(loginDetailsPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(passwordField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 161, Short.MAX_VALUE)
                            .addComponent(usernameField, javax.swing.GroupLayout.DEFAULT_SIZE, 161, Short.MAX_VALUE))
                        .addContainerGap())
                    .addComponent(rememberPassCheckBox)))
            .addGroup(loginDetailsPaneLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(passwordLabel)
                .addContainerGap(125, Short.MAX_VALUE))
            .addGroup(loginDetailsPaneLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(usernameLabel)
                .addContainerGap(144, Short.MAX_VALUE))
            .addGroup(loginDetailsPaneLayout.createSequentialGroup()
                .addGap(13, 13, 13)
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(42, Short.MAX_VALUE))
            .addGroup(loginDetailsPaneLayout.createSequentialGroup()
                .addGap(14, 14, 14)
                .addGroup(loginDetailsPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(passForgotLabel)
                    .addComponent(orLabel)
                    .addComponent(registerLabel))
                .addGap(34, 34, 34))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, loginDetailsPaneLayout.createSequentialGroup()
                .addContainerGap(23, Short.MAX_VALUE)
                .addComponent(jButton1)
                .addGap(17, 17, 17))
        );
        loginDetailsPaneLayout.setVerticalGroup(
            loginDetailsPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(loginDetailsPaneLayout.createSequentialGroup()
                .addGap(39, 39, 39)
                .addComponent(usernameLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(usernameField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(4, 4, 4)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(passwordLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(passwordField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(rememberPassCheckBox)
                .addGap(15, 15, 15)
                .addComponent(jButton1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 22, Short.MAX_VALUE)
                .addComponent(passForgotLabel)
                .addGap(1, 1, 1)
                .addComponent(orLabel)
                .addGap(2, 2, 2)
                .addComponent(registerLabel)
                .addGap(15, 15, 15))
        );

        loginBtnPane.setOpaque(false);

        loginButton.setText("Login");
        loginButton.setFocusPainted(false);

        javax.swing.GroupLayout loginBtnPaneLayout = new javax.swing.GroupLayout(loginBtnPane);
        loginBtnPane.setLayout(loginBtnPaneLayout);
        loginBtnPaneLayout.setHorizontalGroup(
            loginBtnPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(loginBtnPaneLayout.createSequentialGroup()
                .addContainerGap(60, Short.MAX_VALUE)
                .addComponent(loginButton)
                .addContainerGap(64, Short.MAX_VALUE))
        );
        loginBtnPaneLayout.setVerticalGroup(
            loginBtnPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(loginBtnPaneLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(loginButton)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        messagePane.setBackground(new java.awt.Color(204, 255, 204));
        messagePane.setMaximumSize(new java.awt.Dimension(32767, 100));

        messageLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        messageLabel.setText(".");
        messageLabel.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);

        javax.swing.GroupLayout messagePaneLayout = new javax.swing.GroupLayout(messagePane);
        messagePane.setLayout(messagePaneLayout);
        messagePaneLayout.setHorizontalGroup(
            messagePaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, messagePaneLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(messageLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 161, Short.MAX_VALUE)
                .addContainerGap())
        );
        messagePaneLayout.setVerticalGroup(
            messagePaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(messagePaneLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(messageLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 24, Short.MAX_VALUE)
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(messagePane, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(loginBtnPane, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(loginDetailsPane, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(messagePane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(loginDetailsPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(loginBtnPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

private void loginButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loginButtonActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_loginButtonActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JPanel loginBtnPane;
    private javax.swing.JButton loginButton;
    private javax.swing.JPanel loginDetailsPane;
    private javax.swing.JLabel messageLabel;
    private javax.swing.JPanel messagePane;
    private javax.swing.JLabel orLabel;
    private javax.swing.JLabel passForgotLabel;
    private javax.swing.JPasswordField passwordField;
    private javax.swing.JLabel passwordLabel;
    private javax.swing.JLabel registerLabel;
    private javax.swing.JCheckBox rememberPassCheckBox;
    private javax.swing.JTextField usernameField;
    private javax.swing.JLabel usernameLabel;
    // End of variables declaration//GEN-END:variables

    public javax.swing.JButton getLoginButton() {
        return loginButton;
    }

    public javax.swing.JLabel getPassForgotLabel() {
        return passForgotLabel;
    }

    public javax.swing.JPasswordField getPasswordField() {
        return passwordField;
    }

    public javax.swing.JLabel getRegisterLabel() {
        return registerLabel;
    }

    public javax.swing.JCheckBox getRememberPassCheckBox() {
        return rememberPassCheckBox;
    }

    public javax.swing.JTextField getUsernameField() {
        return usernameField;
    }
    
    public javax.swing.JPanel getMessagePane() {
        return messagePane;
    }

    public javax.swing.JLabel getMessageLabel() {
        return messageLabel;
    }

}
